﻿using System;
using System.Web.UI.WebControls;

public partial class aspx_advance_one : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (this.Request.QueryString["id"] == null)
            {
                Response.Redirect("~/");
            }
            try
            {
                int id = int.Parse(this.Request.QueryString["id"]);
                using (ds_名师讲堂TableAdapters.tb_讲堂TableAdapter da = new ds_名师讲堂TableAdapters.tb_讲堂TableAdapter())
                {
                    this.rpt_advance.DataSource = da.GetDataBy讲堂ID(id);
                }
                this.rpt_advance.DataBind();
                ds_名师讲堂.v_名师讲堂视频Row dr = null;
                try
                {
                    using (ds_名师讲堂TableAdapters.v_名师讲堂视频TableAdapter da = new ds_名师讲堂TableAdapters.v_名师讲堂视频TableAdapter())
                    {
                        dr = da.GetDataBy讲堂ID(id).Rows[0] as ds_名师讲堂.v_名师讲堂视频Row;
                    }
                }
                catch (Exception)
                {
                }

                if (dr != null)
                {
                    (this.rpt_advance.FindControl("hp视频连接") as HyperLink).NavigateUrl = string.Format("../video/one.aspx?id={0}#ss", dr.视频ID);
                }
            }
            catch (Exception)
            {
                Response.Redirect("~/");
            }
        }
    }
}